package com.tingfeng.mapper;

import com.tingfeng.pojo.User;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import java.util.List;

public class UserMapperImpl extends SqlSessionDaoSupport implements UserMapper {
    @Override
    public List<User> getUserInfo() {

        User user = new User("5","tt","12345");

        UserMapper mapper = getSqlSession().getMapper(UserMapper.class);
        mapper.add(user);
        mapper.delete(3);

        return mapper.getUserInfo();
    }

    @Override
    public int add(User user) {
        return getSqlSession().getMapper(UserMapper.class).add(user);
    }

    @Override
    public int delete(Integer id) {
        return getSqlSession().getMapper(UserMapper.class).delete(id);
    }
}
